package com.example.publice.error;

import org.apache.shiro.authc.AuthenticationException;

/**
 * 定时任务
 * @author wangkai
 *
 * @date: 2019年5月31日 上午11:32:41
 */
public class TaskException extends AuthenticationException {


	private static final long serialVersionUID = 1L;

	private Code code;

	public TaskException(String msg, Code code)
	{
		this(msg, code, null);
	}

	public TaskException(String msg, Code code, Exception nestedEx)
	{
		super(msg, nestedEx);
		this.code = code;
	}

	public Code getCode()
	{
		return code;
	}

	public enum Code
	{
		TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
	}

}
